<style>
.propro{
	margin: 30px;
	border-collapse: collapse;
	}
.propro td, .propro th{
	border: 1px solid #9FF;
	padding: 10px;
	}




</style>


<div>
<!--按销量输出各类商品-->


                
          <?php
		        //循环输出menu1，并赋id给其超链接
		    $query1 = "select * from product_class where id > 1 order by show_order";
			$result1 = $aa->excu($query1);
			while ($product_class = mysqli_fetch_array($result1, MYSQLI_ASSOC))	{	

		?>
             <div>   
                
                <h3><?php echo $product_class['class_name']; ?></h3>
                <table class="propro">
                        <tr>
                            <th>编号</th><th>商品名</th><th>图片</th><th>价格</th><th>销量</th>
                        </tr>
                <?php
		        //循环输出menu1，并赋id给其超链接
		            $query2 = "select * from product_info where class_id = '".$product_class['id']."' order by sales_volume desc limit 5";
			        $result2 = $aa->excu($query2);
			        while ($row = mysqli_fetch_array($result2, MYSQLI_ASSOC))	{	

		        ?>

               
                        
                        <tr>
                            <td><?php echo $row['id']; ?></td><td><?php echo $row['name']; ?></td>
                            <td><?php $img = $row['imgsrc']; $img = explode("#", $img);?>
                                <img src="../<?php echo $img[0]; ?>" style=" width: 30px; height: 30px;"/></td>
                            <td><?php echo $row['price']; ?></td><td><?php echo $row['sales_volume']; ?></td>
                        </tr>
                        
                      
               
               
                 <?php  }	?>
                 </table>
             </div>
         <?php  }	?>










</div>